Math.reverseLerp Method

Returns the linear interpolation parameter t for the value y.
 
 
Static This method is static.

Parameters

a

Type: Number
The value to interpolate from.
b

Type: Number
The value to interpolate to.
y

Type: Number
The value to find the parameter for.

Return Value


Type: Number
Parameter for this interpolator that corresponds to x. 

Remarks

Performs linear interpolation for values in the domain [0, 1] to the range [a, b]. That is, given the points (0, a) and (1, b) this solves for t in the point (t, y).